<template>
  <div>
    <!-- 公共头部 -->
    <header class="header">
      <span v-if="$route.meta.back" @click="$router.go(-1)" class="back">返回</span>
      <div class="text">{{$route.meta.title}}</div>
      <router-link to="/register" v-if="$route.meta.register" class="register">注册</router-link>
    </header>
    <!-- 一级视图 -->
    <router-view class="con"></router-view>
  </div>
</template>

<script>
export default {};
</script>

<style lang="less" scoped>
@import "./less/index.less";

.con{
  padding-top: 0.8rem;
}
.header{
  width: 100vw;
  height: @headerHeight;
  background-color: @primary;
  position: fixed;
  top: 0;
  left: 0;
}
.back{
  position: absolute;
  top: 0;
  left: 0.2rem;
  line-height: @headerHeight;
  color: #fff;
  font-size: @font-h2;

}
.text{
  text-align: center;
  line-height: @headerHeight;
  color: #fff;
  font-size: @font-h2;

}
.register{
  position: absolute;
  top: 0;
  right: 0.2rem;
  line-height: @headerHeight;
  color: #fff;
  font-size: @font-h2;

}
</style>